from ui.plugin_base import PluginBase
from .data_view_widget import DataViewWidget
from loguru import logger


class DataViewPlugin(PluginBase):
    def __init__(self):
        super().__init__()
        self._widget = None
    
    def get_name(self):
        return "摸鱼数据"

    def get_widget(self):
        if self._widget is None:
            self._widget = DataViewWidget()
        return self._widget
    
    def cleanup(self):
        """清理资源"""
        if self._widget:
            self._widget.cleanup()
        
        logger.info("DataViewPlugin 资源清理完成")